<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>

<div class="data_list">
		<div class="data_list_title">
		<img src="/static/images/search_icon.png"/>
		搜索&nbsp;<font color="red">${searchStr }</font>&nbsp;的结果 &nbsp;(总共搜索到&nbsp;${pageBean.totalRecord }&nbsp;条记录) </div>
		<div class="datas search">
		  <ul>
		  	<c:choose>
		  		<c:when test="${pageBean.totalRecord == 0 }">
		  			<div align="center" style="padding-top: 20px">未查询到结果，请换个关键字试试看！</div>
		  		</c:when>
		  		<c:otherwise>
		  			<c:forEach var="blog" items="${pageBean.data}">
		  				<li style="margin-bottom: 20px">
						  	<span class="title"><a href="${pageContext.request.contextPath}/blog/show/${blog.id }.html" target="_blank">${blog.title }</a></span>
						  	<span class="summary">摘要:${blog.content }...</span>
						  	<span class="link"><a href="${pageContext.request.contextPath}/blog/show/${blog.id }.html">http://www.tianpengcc.com/blog/show/${blog.id }.html</a>&nbsp;&nbsp;&nbsp;&nbsp;发布日期：<fmt:formatDate value="${blog.releaseTime }" type="date" pattern="yyyy-MM-dd"/></span>
						  </li>
		  			</c:forEach>
		  		</c:otherwise>
		  	</c:choose>
		  </ul>
		</div>
		<nav>
			<ul class='pager'>
				<c:if test="${pageBean.pageNumber == 1 }">
					<li class='disabled'><a href='#'>上一页</a></li>
				</c:if>
				<c:if test="${pageBean.pageNumber != 1 }">
					<li><a href='${pageContext.request.contextPath }/blog/search/${pageBean.pageNumber - 1 }.html?searchStr=${searchStr}'>上一页</a></li>
				</c:if>
				<c:if test="${pageBean.pageNumber == pageBean.totalPage }">
					<li class='disabled'><a href='#'>下一页</a></li>
				</c:if>
				<c:if test="${pageBean.pageNumber != pageBean.totalPage }">
					<li><a href='${pageContext.request.contextPath }/blog/search/${pageBean.pageNumber + 1 }.html?searchStr=${searchStr}'>下一页</a></li>
				</c:if>
			</ul>
		</nav>
</div>
